package JVM;

public class test2 {

    public static void main(String[] args) throws InterruptedException {
        Object o=new Object();
        Thread t=new Thread(()->{
            synchronized (o){
                System.out.println("hahahah");
                try {
                    o.wait();
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            }
        });
        t.start();
        System.out.println("finnished");
        Thread.sleep(2000);
        synchronized (o){
            o.notify();
        }
    }
}
